package com.tourism.www.common.result;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.List;

public class PageResult<T> {

    private final IPage<T> page;

    public PageResult(IPage<T> page) {
        this.page = page;
    }

    @Schema(description = "结果记录集")
    public List<T> getRecords() {
        return this.page.getRecords();
    }

    @Schema(description = "结果总数")
    public long getTotal() {
        return this.page.getTotal();
    }

    @Schema(description = "每页大小")
    public long getSize() {
        return this.page.getSize();
    }

    @Schema(description = "当前页")
    public long getCurrent() {
        return this.page.getCurrent();
    }


}
